package com.csweimei.rentmanagementtreasure.tenant.viewModel;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.http.entity.HouseFollowRecordBean;
import com.csweimei.rentmanagementtreasure.tenant.ui.act.customer.CustomerInfoActivity;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.MultiItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class HouseFRItemVM extends MultiItemViewModel {
    public HouseFRItemVM(@NonNull BaseViewModel viewModel) {
        super(viewModel);
    }

    public ObservableField<HouseFollowRecordBean.DataDTO> entity = new ObservableField<>();

    public void setData(HouseFollowRecordBean.DataDTO dataDTO) {
        entity.set(dataDTO);
    }

    public BindingCommand look = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putString(AppConfig.BUNDLE_KEY,entity.get().getCustomID()+"");
            bundle.putString(AppConfig.BUNDLE_KEY2,"person");
            viewModel.startActivity(CustomerInfoActivity.class,bundle);
        }
    });
}
